import { reactive } from 'vue';
import { defineStore } from 'pinia';
import menus from '@/mockjs/user.js';
export default defineStore({
    id: 'user',
    state: () => {
        return {
            userInfo: {},
            permissions: [],
            menus,
        }
    },
    actions: {
        login(userData) {
            Object.assign(this.userInfo, userData);
        }

    },
    persist: {
        storage: localStorage,
        paths: ['token', 'userInfo', 'permissions', 'menus'],
    }
});
